import React from 'react'
// ===================================================================== global declare
const { $Lazy, $fn } = window
// ===================================================================== Lazy
const Modal			= $Lazy.state(()=>import('@antd/modal'))
// 
const PatientDetail =  $Lazy.state(()=>import('@views/_public/patient-detail'))
// ===================================================================== component
class Index extends React.Component{
	state = {
		
	}
	
	open = spec_code => {
		this.modal.open()
		this.infoRef.load(spec_code, 'ts')
	}
	
	render(){
		const { onRefresh }  = this.props
		return (
			<Modal
				width 		= '99%'
				onRef		= { ref => this.modal = ref }
				title		= '修改资料'
				okText		= '提交审核'
				enter		= { true }
				onOk		= { () => this.infoRef.formRef.submit() }
				isFullScroll
			>
				<PatientDetail  
					onRef		= { ref => this.infoRef = ref }
					pop
					onRefresh	= { ()=>{
						$fn.delay(()=>{
							onRefresh?.()
						})
						this.modal.close()
					} } 
				/>
			</Modal>
		)
	}
}

export default Index